----------------------------------------------------------------
-- Global Variables
----------------------------------------------------------------

EA_Window_RolePlayPopup = {}

----------------------------------------------------------------
-- Local Variables
----------------------------------------------------------------

----------------------------------------------------------------
-- EA_Window_RolePlayPopup Functions
----------------------------------------------------------------

function EA_Window_RolePlayPopup.Initialize()       

    LabelSetText( "EA_Window_RolePlayPopupTitleBarText", GetPregameString( StringTables.Pregame.LABEL_ROLE_PLAYING_ADDENDUM_TITLE))
    bodyText = GetPregameString( StringTables.Pregame.LABEL_RP_ADDENDUM1)..GetPregameString( StringTables.Pregame.LABEL_RP_ADDENDUM2)
    LabelSetText( "EA_Window_RolePlayPopupScrollWindowScrollChildLabel", bodyText)
    ButtonSetText("EA_Window_RolePlayPopupAcceptButton", GetPregameString( StringTables.Pregame.LABEL_PRESELECT_ACCEPT ))
    ButtonSetText("EA_Window_RolePlayPopupDeclineButton", GetPregameString( StringTables.Pregame.LABEL_PRESELECT_DECLINE ))

    ScrollWindowUpdateScrollRect( "EA_Window_RolePlayPopupScrollWindow" )
end

function EA_Window_RolePlayPopup.Shutdown()
end

function EA_Window_RolePlayPopup.Show()
    WindowSetShowing("EA_Window_RolePlay", true)
end

function EA_Window_RolePlayPopup.ToggleShowing()
    local showing = WindowGetShowing("EA_Window_RolePlay")
    WindowSetShowing("EA_Window_RolePlay", not showing)
end

function EA_Window_RolePlayPopup.Accept()
    if (DoesWindowExist("ServerSelectWindow")) then
        ServerSelectWindow.SelectServerAddendumAccepted()
    end
    WindowSetShowing("EA_Window_RolePlay", false)
end

function EA_Window_RolePlayPopup.Decline()
    WindowSetShowing("EA_Window_RolePlay", false)
end
